<template>
  <div class="admin-dashboard">
    <el-card>
      <h2>管理后台</h2>
      <el-tabs>
        <el-tab-pane label="用户管理">
          <el-table :data="users">
            <el-table-column prop="userID" label="ID" />
            <el-table-column prop="username" label="用户名" />
            <el-table-column prop="usertype" label="类型" />
            <el-table-column prop="userstatus" label="状态" />
            <el-table-column prop="useraccount" label="账户余额" />
          </el-table>
        </el-tab-pane>
        <el-tab-pane label="报修管理">
          <el-table :data="repairs">
            <el-table-column prop="repairID" label="报修单号" />
            <el-table-column prop="pileID" label="充电桩编号" />
            <el-table-column prop="repairmiaoshu" label="描述" />
            <el-table-column prop="repairprogress" label="进度" />
          </el-table>
        </el-tab-pane>
      </el-tabs>
    </el-card>
  </div>
</template>

<script>
import api from '@/api';
export default {
  data() {
    return { users: [], repairs: [] };
  },
  async created() {
    this.users = await api.get('/user/list');
    this.repairs = await api.get('/repair/list');
  }
};
</script>

<style scoped>
.admin-dashboard { max-width: 1000px; margin: 40px auto; }
</style>
